#include <QtGui/QApplication>
#include "widget.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget *qw = new Widget();
    QListWidget *listwidget = new QListWidget();
    qw->setWindowTitle("djife");
    //qw->adjustSize();

    Phonon::MediaObject *media = new Phonon::MediaObject();
    media->setCurrentSource(Phonon::MediaSource("E:\\baidu player\\1942.rmvb"));
    Phonon::VideoWidget *vw = new Phonon::VideoWidget();
    vw->adjustSize();
    Phonon::createPath(media, vw);

    Phonon::AudioOutput *aOutput = new Phonon::AudioOutput();
    Phonon::createPath(media, aOutput);

    Phonon::VolumeSlider *vs = new Phonon::VolumeSlider();
    vs->setAudioOutput(aOutput);
    //vs->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

    Phonon::SeekSlider *ss = new Phonon::SeekSlider(media);

    QLabel *label = new QLabel();
    label->setText("Volume:");

    QHBoxLayout *hl = new QHBoxLayout();
    hl->addWidget(label);
    hl->addWidget(vs);

    QVBoxLayout *vl = new QVBoxLayout(qw);
    vl->addWidget(vw);
    //vl->addWidget(vs);
    vl->addLayout(hl);
    vl->addWidget(ss);

    media->play();

    qw->show();


    
    return a.exec();
}
